<!DOCTYPE HTML>
<html>
    <head>
    <meta charset="utf-8"/>
	<!-- <meta name="description" content="Creating a table with Bootstrap. Learn how to use Bootstrap toolkit to create Tables with examples."> -->
	<!-- <link href="https://cdn.bootcss.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> -->
	<script type="text/javascript">
	function getNowFormatDate(){
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
            + " " + date.getHours() + seperator2 + date.getMinutes()
            + seperator2 + date.getSeconds();
    return currentdate;
} 
	 function correct(form)
	 {
	       for(var k=0;k<parseInt(localStorage.length/5);k++)
		   {if(localStorage.getItem(k+1)!=document.getElementById("user_text").value)
		      continue;
		      else 
			  if(localStorage.getItem("password"+(k+1))==document.getElementById("user_password").value)
			  {alert("success!");
			  var data2=getNowFormatDate();
			  localStorage.setItem(document.getElementById("user_text").value+"_log_time",data2);
			  localStorage.setItem("now",document.getElementById("user_text").value);
			  window.location.href="https://siriuspotter.gitee.io/success/";
			  
              return true;}
			  else 
			  {alert("wrong password!");
			  return false;}}
			  alert("your username don't exist!");	   
	 }

	</script>
		<style>
		.h{text-align:center;}
		.form {
       margin: auto;
       width: 300px;
       border: 3px solid #73AD21;
       padding: 20px;} 
	   .p{font-size:10px;}
	   .input{height:30px;}
</style>
    </head>
<body>
<h1 class="h">一个登录页面</h1>
    <div class="form">
    <form name="sign_in" method="post" onsubmit="return correct(this)">
        <p>name:
            <input type="text" name="user_text" id="user_text" maxlength="25" size="35"required="required"/>
        </p>
        <p>password:
            <input type="password" name="user_password" id="user_password" maxlength="25" size="35"required="required">
        </p>
      <input type="submit" value="sign in">
    </form>
</body>
</html>